function trim(myString){
	return myString.replace(/^\s+/, '').replace(/\s+$/, '');
}

function replaceAll(str,oldstr,newstr){
	while(str.indexOf(oldstr) != -1){
		str = str.replace(oldstr,newstr);
	}
	return str;
}